<?php use_helper('Object', 'Validation', 'ObjectAdmin', 'I18N', 'Date') ?>
<title><?= $sf_response->getTitle() ?></title>
<?php use_stylesheet('/sf/sf_admin/css/main') ?>
<div id="sf_admin_container">
<h1>View <?php echo $component->getDescription() ?></h1>
<div id="sf_admin_content">

<fieldset id="sf_fieldset_none" class="">

<div class="form-row">
  <?php echo label_for('component[productcode]', __($labels['component{productcode}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('component{productcode}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{productcode}')): ?>
    <?php echo form_error('component{productcode}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($component, 'getProductcode', array (
  'size' => 25,
  'control_name' => 'component[productcode]',
  'disabled'=>1,
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[description]', __($labels['component{description}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('component{description}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{description}')): ?>
    <?php echo form_error('component{description}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($component, 'getDescription', array (
  'size' => 80,
  'control_name' => 'component[description]',
  'disabled'=>1,
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[category]', __($labels['component{category}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('component{category}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{category}')): ?>
    <?php echo form_error('component{category}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

<!--Tien-->
<select name="component[category]" id="component_category" disabled">
<?php
    $categorylist = CommonValues::$gCompCategory['key'];
    $category = $component->getCategory() ? $component->getCategory() : 0;
    foreach ($categorylist as $key => $value)
    { 
    	echo '<option value="' . $value.'" ';
    	if ($value == $category) 
    	   echo  'selected="selected" >';
    	else echo '>';
    	echo $key;
    	echo '</option>';
    }
?>
</select>


    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[componenttype_id]', __($labels['component{componenttype_id}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('component{componenttype_id}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{componenttype_id}')): ?>
    <?php echo form_error('component{componenttype_id}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php 
  $value = object_select_tag($component, 'getComponenttypeId', array (
  'related_class' => 'ComponentType',
  'control_name' => 'component[componenttype_id]',
  'disabled'=>1,
)); 
   echo $value ? $value : '&nbsp;' 
?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[location]', __($labels['component{location}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('component{location}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{location}')): ?>
    <?php echo form_error('component{location}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($component, 'getLocation', array (
  'size' => 80,
  'control_name' => 'component[location]',
  'disabled'=>1,
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[brand]', __($labels['component{brand}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('component{brand}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{brand}')): ?>
    <?php echo form_error('component{brand}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_input_tag($component, 'getBrand', array (
  'size' => 80,
  'control_name' => 'component[brand]',
  'disabled'=>1,
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[componentunit_id]', __($labels['component{componentunit_id}']), 'class="required" ') ?>
  <div class="content<?php if ($sf_request->hasError('component{componentunit_id}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{componentunit_id}')): ?>
    <?php echo form_error('component{componentunit_id}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <?php $value = object_select_tag($component, 'getComponentunitId', array (
  'related_class' => 'ComponentUnit',
  'control_name' => 'component[componentunit_id]',
  'disabled'=>1,
)); echo $value ? $value : '&nbsp;' ?>
    </div>
</div>

<div class="form-row">
  <?php echo label_for('component[minstockqty]', __($labels['component{minstockqty}']), '') ?>
  <div class="content<?php if ($sf_request->hasError('component{minstockqty}')): ?> form-error<?php endif; ?>">
  <?php if ($sf_request->hasError('component{minstockqty}')): ?>
    <?php echo form_error('component{minstockqty}', array('class' => 'form-error-msg')) ?>
  <?php endif; ?>

  <input type = "text" name ='component[minstockqty]' id ='component_minstockqty'  disabled value ="<? echo $component->getMinstockqty()?>">
    </div>
</div>

</fieldset>

</div>
</div>